/**
 *  订单主数据 
 */
package com.kaluli.project.domain.entity;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.kaluli.system.domain.entity.DomainEntity;
import java.io.Serializable;

/**
 * @author zyzowen1944
 * 
 */
@Entity
@Table(name = "kll_main_order")
public class KllMainOrder extends DomainEntity implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	@Column(name="order_number")
	private String orderNumber;
	@Column(name="ibilling_number")
	private String ibillingNumber;
	@Column(name="trade_no")
	private String tradeNo;
	@Column(name="hupu_uid")
	private Integer hupuUid;
	@Column(name="hupu_username")
	private String hupuUsername;
	@Column(name="express_fee")
	private Double expressFee;
	@Column(name="total_price")
	private Double totalPrice;
	@Column(name="original_price")
	private Double originalPrice;
	@Column(name="duty_fee")
	private Double dutyFee;
	@Column(name="marketing_fee")
	private Double marketingFee;
	@Column(name="coupon_fee")
	private Double couponFee;
	@Column(name="number")
	private Integer number;
	@Column(name="order_time")
	private Timestamp orderTime;
	@Column(name="pay_time")
	private Timestamp payTime;
	@Column(name="refund")
	private Double refund;
	@Column(name="pay_type")
	private int payType;
	public String getOrderNumber() {
		return orderNumber;
	}
	public void setOrderNumber(String orderNumber) {
		this.orderNumber = orderNumber;
	}
	public String getIbillingNumber() {
		return ibillingNumber;
	}
	public void setIbillingNumber(String ibillingNumber) {
		this.ibillingNumber = ibillingNumber;
	}
	public Integer getHupuUid() {
		return hupuUid;
	}
	public void setHupuUid(Integer hupuUid) {
		this.hupuUid = hupuUid;
	}
	public String getHupuUsername() {
		return hupuUsername;
	}
	public void setHupuUsername(String hupuUsername) {
		this.hupuUsername = hupuUsername;
	}
	public Double getExpressFee() {
		return expressFee;
	}
	public void setExpressFee(Double expressFee) {
		this.expressFee = expressFee;
	}
	public Double getTotalPrice() {
		return totalPrice;
	}
	public void setTotalPrice(Double totalPrice) {
		this.totalPrice = totalPrice;
	}
	public Double getOriginalPrice() {
		return originalPrice;
	}
	public void setOriginalPrice(Double originalPrice) {
		this.originalPrice = originalPrice;
	}
	public Double getMarketingFee() {
		return marketingFee;
	}
	public void setMarketingFee(Double marketingFee) {
		this.marketingFee = marketingFee;
	}
	public Double getCouponFee() {
		return couponFee;
	}
	public void setCouponFee(Double couponFee) {
		this.couponFee = couponFee;
	}
	public Integer getNumber() {
		return number;
	}
	public void setNumber(Integer number) {
		this.number = number;
	}
	public Timestamp getOrderTime() {
		return orderTime;
	}
	public void setOrderTime(Timestamp orderTime) {
		this.orderTime = orderTime;
	}
	public Timestamp getPayTime() {
		return payTime;
	}
	public void setPayTime(Timestamp payTime) {
		this.payTime = payTime;
	}
	public Double getRefund() {
		return refund;
	}
	public void setRefund(Double refund) {
		this.refund = refund;
	}
	public Integer getSource() {
		return source;
	}
	public void setSource(Integer source) {
		this.source = source;
	}
	public Integer getStatus() {
		return status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
	public Timestamp getCreatedAt() {
		return createdAt;
	}
	public void setCreatedAt(Timestamp createdAt) {
		this.createdAt = createdAt;
	}
	public Timestamp getUpdatedAt() {
		return updatedAt;
	}
	public void setUpdatedAt(Timestamp updatedAt) {
		this.updatedAt = updatedAt;
	}
	@Column(name="source")
	private Integer source;
	@Column(name="status")
	private Integer status;
	@Column(name="created_at")
	private Timestamp createdAt;
	@Column(name="updated_at")
	private Timestamp updatedAt;
	
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY,targetEntity=KllMainOrderDetail.class)
	@JoinColumn(name="order_number",referencedColumnName="order_number",insertable = false, updatable = false)
	private Set<KllMainOrderDetail> kllMainOrderDetails=new HashSet<KllMainOrderDetail>();
	public Set<KllMainOrderDetail> getKllMainOrderDetails() {
		return kllMainOrderDetails;
	}
	public void setKllMainOrderDetails(Set<KllMainOrderDetail> kllMainOrderDetails) {
		this.kllMainOrderDetails = kllMainOrderDetails;
	}
	
	@OneToOne(cascade=CascadeType.ALL,fetch=FetchType.LAZY,targetEntity=KllMainOrderAttr.class)
	@JoinColumn(name="order_number",referencedColumnName="order_number",insertable = false, updatable = false)
	private KllMainOrderAttr kllMainOrderAttr;
	public KllMainOrderAttr getKllMainOrderAttr() {
		return kllMainOrderAttr;
	}
	public void setKllMainOrderAttr(KllMainOrderAttr kllMainOrderAttr) {
		this.kllMainOrderAttr = kllMainOrderAttr;
	}
	
	@Column(name="syn_api")
	private Integer synApi;
	public Integer getSynApi() {
		return synApi;
	}
	public void setSynApi(Integer synApi) {
		this.synApi = synApi;
	}
	
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
	@JoinColumn(name="order_number",referencedColumnName="order_number",insertable = false, updatable = false)
	private Set<KllOrderLogistics> kllOrderLogisticses;
	public Set<KllOrderLogistics> getKllOrderLogisticses() {
		return kllOrderLogisticses;
	}
	public void setKllOrderLogisticses(Set<KllOrderLogistics> kllOrderLogisticses) {
		this.kllOrderLogisticses = kllOrderLogisticses;
	}
	
	@Column(name="channel_id")
	private Integer channelId;

	@Column(name="finance_audit")
	private Integer financeAudit;

	@Column(name="is_associate")
	private Integer associate;


	public Integer getAssociate() {
		return associate;
	}

	public void setAssociate(Integer associate) {
		this.associate = associate;
	}

	public Integer getChannelId() {
		return channelId;
	}
	public void setChannelId(Integer channelId) {
		this.channelId = channelId;
	}
	public String getTradeNo() {
		return tradeNo;
	}
	public void setTradeNo(String tradeNo) {
		this.tradeNo = tradeNo;
	}
	public int getPayType() {
		return payType;
	}
	public void setPayType(int payType) {
		this.payType = payType;
	}
	public Double getDutyFee() {
		return dutyFee;
	}
	public void setDutyFee(Double dutyFee) {
		this.dutyFee = dutyFee;
	}

	public Integer getFinanceAudit() {
		return financeAudit;
	}

	public void setFinanceAudit(Integer financeAudit) {
		this.financeAudit = financeAudit;
	}
}
